package cvsexercise8;

public class BasicInheritance {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		/* Write out a start message to the console */
		System.out.println("Exercise 8 - Inheritance started");
		
		/* Instantiate an object of the Rectangle class
		 * NOTE: Use the constructor to provide a colour for the object
		 *       along with a length and height for the rectangle
		 */
		Rectangle myRectangle = new Rectangle("red", 2.5, 1.5);
		
		/* Instantiate an object of the Triangle class
		 * NOTE: Use the constructor to provide a colour for the object
		 *       along with a base and width for the rectangle
		 */
		Triangle myTriangle = new Triangle("blue", 3.0, 1.5);
		
		/* Use the toString() method to output the current superclass and colour of both shapes */
		System.out.println(myRectangle.toString());
		System.out.println(myTriangle.toString());
		
		/* Invoke the getArea() method of the Rectangle class and write out the resulting area value */
		double dRArea = myRectangle.getArea();
		System.out.println("Area of myRectangle = " + dRArea);
		
		/* Invoke the getArea() method of the Triangle class and write out the resulting area value */
		double dTArea = myTriangle.getArea();
		System.out.println("Area of myTriangle = " + dTArea);
		
		/* Write out a completed message to the console */
		System.out.println("Exercise 8 - Inheritance completed");
	}
}
